// components/search-bar.js
Component({

    /**
     * 组件的属性列表
     */
    properties: {
        city: {
            type: String,
            value: '武汉',
        },
        placeholder: {
            type: String,
            value: '搜索感兴趣的活动',
        },
        leftImg: {
            type: String,
            value: '',
        },
        rightImg: {
            type: String,
            value: '',
        },
    },

    /**
     * 组件的初始数据
     */
    data: {
        key: ''
    },

    /**
     * 组件的方法列表
     */
    methods: {
        leftTap(e) {
            this.triggerEvent('left', e.target.dataset);
        },
        rightTap(e) {
            this.triggerEvent('right', this.data.key);
        },
        bindinput(e) {
            this.data.key = e.detail;
        },
        searchTap() {
            this.triggerEvent('search', this.data.key);
        }
    }
})